<!-- $Id: mshop_list.htm 14216 2008-03-10 02:27:21Z testyang $ -->

{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}

<div class="form-div">
  <form action="javascript:searchMshop()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {$lang.mshop_id}：<input type="text" name="mshop_id" size="30" />
    {$lang.user_name}：<input type="text" name="keyword" size="30" /> 
     <br><br />
    {$lang.sum_amount}：<input type="text" name="min_amount" size="10" />-<input type="text" name="max_amount" size="10" />&nbsp;
     {$lang.sum_profit}：<input type="text" name="min_profit" size="10" />-<input type="text" name="max_profit" size="10" />&nbsp;
     {$lang.sum_cash_amount}：<input type="text" name="min_cash" size="10" />-<input type="text" name="max_cash" size="10" />&nbsp;
    &nbsp;&nbsp;<input type="submit" value="{$lang.button_search}" class="button" />
    
       <input type="hidden" name="chose_pid" size="8"  value="{$chose_pid}"/>
       
  </form>
</div>

<form method="post" action="mshop.php" name="listForm" onsubmit="return confirm(batch_drop_confirm);">
<!-- start mshop list -->
<div class="list-div" id="listDiv">
{/if}

{if $chose_pid}
<table cellpadding="3" cellspacing="1">
    <tr>
      <th>
        <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
        <a href="javascript:listTable.sort('mshop_id'); ">{$lang.mshop_id}</a>{$sort_mshop_id}</th>
      <th>{$lang.user_name}</th>
      <th>{$lang.mobile_phone}</th>

    </tr>

    {foreach from=$mshop_list item=mshop}
    <tr onclick="chose_user({$mshop.mshop_id},'{$mshop.mshop_name}')">
      <td><input value="{$mshop.mshop_id}" name="checkboxes[]" type="checkbox">{$mshop.mshop_id}</td>
      <td align="left">{$mshop.mshop_name|escape:html} { if $mshop.user_name}(绑定会员{$mshop.user_name|escape:html}){/if}</td>
      <td align="center">{$mshop.mobile_phone}</td>

     
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="13">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td><!--<input type="submit" name="drop" id="btnSubmit" value="{$lang.drop}" class="button" disabled="true" />-->
<!--      <input type="submit" name="cash_money" id="btnSubmit" value="提现" class="button" disabled="true" />
      <input type="hidden" name="act" value="batch" /></td>-->
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>
  <script>
function chose_user(mshop_id,name)
{
	 window.opener.document.getElementById("mshop_pid").value=mshop_id;
	 window.opener.document.getElementById("p_user_name").value=name;
	/* window.opener.location.reload();*/
	 window.close(); 
}


</script>
{else}
<table cellpadding="3" cellspacing="1">
    <tr>
      <th>
        <input onclick='listTable.selectAll(this, "checkboxes")' type="checkbox" />
        <a href="javascript:listTable.sort('mshop_id'); ">{$lang.mshop_id}</a>{$sort_mshop_id}</th>
      <th>{$lang.user_name}</th>

      <th>{$lang.sum_amount}</th>
      <th><a href="javascript:listTable.sort('sum_cash_amount'); ">已提现(元)</a>{$sort_sum_cash_amount}</th>
      <th><a href="javascript:listTable.sort('sum_profit'); ">{$lang.sum_profit}</a>{$sort_sum_profit}</th>
      <th>{$lang.mobile_phone}</th>
      <th><a href="javascript:listTable.sort('sort_order'); ">{$lang.sort_order}</a>{$sort_sort_order}</th>
      <th>{$lang.ctime}</th>
      <th>{$lang.handler}</th>
    </tr>

    {foreach from=$mshop_list item=mshop}
    <tr>
      <td><input value="{$mshop.mshop_id}" name="checkboxes[]" type="checkbox">{$mshop.mshop_id}</td>
      <td align="left">{$mshop.mshop_name|escape:html} { if $mshop.user_name}(绑定会员{$mshop.user_name|escape:html}){/if}</td>

      <td align="center">{$mshop.sum_amount}</td>
      <td align="center">{$mshop.sum_cash_amount}</td>
      <td align="center">{$mshop.sum_profit}</td> 
      <td align="center">{$mshop.mobile_phone}</td>
      <td align="center">{$mshop.sort_order}</td>
      <td align="center">{$mshop.ctime}</td>
     
      <td align="center">
        <a href="mshop.php?act=edit&amp;id={$mshop.mshop_id}" title="{$lang.edit}"><img src="images/icon_edit.gif" border="0" height="16" width="16" /></a>
        <a href="javascript:;" onclick="listTable.remove({$mshop.mshop_id},'{$lang.b_drop_confirm}')" title="{$lang.remove}"><img src="images/icon_drop.gif" border="0" height="16" width="16" /></a> 
     {if ($mshop.lock_profit)!='0.00' }<a href="mshop.php?act=unlock_profit&amp;id={$mshop.mshop_id}" title="锁定佣金解锁"><img src="images/icon_account.gif" border="0" height="16" width="16" /></a>{/if}

	<!-- <a href="mshop.php?act=mshop_build_url&amp;mshop_id={$mshop.mshop_id}" title="生成链接密钥"><img src="images/icon_account.gif" border="0" height="16" width="16" /></a>-->
     <a href="mshop.php?act=get_mshop_url&amp;mshop_id={$mshop.mshop_id}" title="查看链接信息"><img src="images/icon_view.gif" border="0" height="16" width="16" /></a>
    </td>
    </tr>
    {foreachelse}
    <tr><td class="no-records" colspan="13">{$lang.no_records}</td></tr>
    {/foreach}
  </table>

  <table cellpadding="4" cellspacing="0">
    <tr>
      <td><!--<input type="submit" name="drop" id="btnSubmit" value="{$lang.drop}" class="button" disabled="true" />-->
<!--      <input type="submit" name="cash_money" id="btnSubmit" value="提现" class="button" disabled="true" />
      <input type="hidden" name="act" value="batch" /></td>-->
      <td align="right">{include file="page.htm"}</td>
    </tr>
  </table>
{/if}
  

{if $full_page}
</div>
<!-- end mshop list -->
</form>

<script type="text/javascript" language="JavaScript">
<!--
  listTable.recordCount = {$record_count};
  listTable.pageCount = {$page_count};

  {foreach from=$filter item=item key=key}
  listTable.filter.{$key} = '{$item}';
  {/foreach}

  {literal}
  onload = function()
  {
    document.forms['searchForm'].elements['keyword'].focus();

    startCheckOrder();
  }

  /**
   * 搜索团购活动
   */
  function searchMshop()
  {
    var mshop_id = Utils.trim(document.forms['searchForm'].elements['mshop_id'].value); 
	listTable.filter['mshop_id'] = mshop_id;
    var keyword = Utils.trim(document.forms['searchForm'].elements['keyword'].value); 
	listTable.filter['keyword'] = keyword;
	
  
  	var min_amount = Utils.trim(document.forms['searchForm'].elements['min_amount'].value);
	listTable.filter['min_amount'] = min_amount;
	
	var max_amount = Utils.trim(document.forms['searchForm'].elements['max_amount'].value);
	listTable.filter['max_amount'] = max_amount;
	
	var max_profit = Utils.trim(document.forms['searchForm'].elements['max_profit'].value);
	listTable.filter['max_profit'] = max_profit;
	
	var min_profit = Utils.trim(document.forms['searchForm'].elements['min_profit'].value);
	listTable.filter['min_profit'] = min_profit; 
	
	
	var min_frozen = Utils.trim(document.forms['searchForm'].elements['min_cash'].value);
	listTable.filter['min_cash'] = min_frozen;
	
	var max_frozen = Utils.trim(document.forms['searchForm'].elements['max_cash'].value);
	listTable.filter['max_cash'] = max_frozen; 
	
	listTable.filter['chose_pid'] = Utils.trim(document.forms['searchForm'].elements['chose_pid'].value);
	
	
    listTable.filter['page'] = 1;
    listTable.loadList("mshop_list");
  }
  
  function cash_money()
  {
		  if(confirm('确认要全部提现吗？'))
		  {
			  location.href="mshop.php?act=cash_all_money";
		  }

  } 
  {/literal}
//-->
</script>

{include file="pagefooter.htm"}
{/if}